#ifndef PATH
#define PATH

#include "array.h"
#include "aabbox.h"
#include "../../texture/draw.h"

namespace sleek
{
    namespace core
    {
        namespace math
        {
            enum PATH_CURVE_STYLE
            {
                PCS_BEZIER,
                PCS_COUNT
            };

            template<typename T>
            class path
            {
                public:
                    path();
                    ~path();

                    void add(vector2d<T> a);
                    void rmv(u32);

                    aabbox2d<T> getBox();
                    void scale(vector2d<T>);
                    void simplify(f32 factor = 10.f);
                    void smooth(f32 factor = 10.f);

                    void curve(PATH_CURVE_STYLE, f32 factor = 10.f);
                    vector2d<T> getDistance(u32, u32);
                    vector2d<T> getDistance();

                    void simplify(u32, u32, f32 factor = 10.f);
                    void smooth(u32, u32, f32 factor = 10.f);
                    void scale(u32, u32, vector2d<T>);
                    aabbox2d<T> getBox(u32, u32);

                    void merge(path<T>);
                    void setLoop(bool);
                    bool isLoop();

                    void render(texture::draw*);
                    void removeDouble();
                protected:
                    bool loop;
                    aabbox2d<T> box;
                    virtual void recalculateBoundingBox();
                    array<vector2d<T> > lisp;
            };
        }
    }
}

#endif
